﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using buildingLib.fee;

namespace _dmis.fee
{
    public partial class FeeTemplateNameInput : Form
    {
        public FeeTemplateNameInput(InvoiceItems items)
        {
            m_items = items;
            InitializeComponent();
        }
        InvoiceItems m_items;
        FeeTemplate template;
        private void FeeTemplateNameInput_Load(object sender, EventArgs e)
        {
            template = FeeTemplate.NewFeeTemplate(false);
            foreach (InvoiceItem item in m_items)
            {
                template.Items.Add(item);
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            template.Name = textBox1.Text;
            template.Memo = textBox2.Text;
            template.Save();
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}